package com.eliza.navs.fg

import android.os.Bundle
import android.util.Log
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.Navigation
import com.eliza.navs.R

class Fg1 : Fragment() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
        val view = inflater.inflate(R.layout.fragment_fg1, container, false)


        var ags = Bundle().apply {
            this.putString("Name", "法外狂徒")
        }
        Log.d(this::class.java.name, "Bundle:FG1 ==> FG2 数据")

        view.findViewById<View>(R.id.fg1_btn).setOnClickListener {
            Navigation.findNavController(view).navigate(R.id.action_fg1_to_fg2, ags)
        }
        return view
    }


}